/*
 * @Author: Administrator
 * @Date:   2017-11-11 11:03:00
 * @Last Modified by:   Administrator
 * @Last Modified time: 2018-02-05 14:52:38
 */
const path = require('path')
const webpack = require('webpack')
const ROOT_PATH = path.resolve(__dirname)
const vendors = [  'react', 'react-dom', 'react-router', 'react-router-dom', 'es6-promise', 'axios']
module.exports = {
  devtool: false,
  entry: {
    vendor: vendors
  },
  output: {
    path: path.resolve(__dirname, 'dist/lib'),
    filename: '[name].dll.js',
    library: '[name]_lib'
  },
  plugins: [
    new webpack.optimize.UglifyJsPlugin({
      output: {
        comments: false // remove all comments
      },
      compress: {
        warnings: false
      }
    }),
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('production')
      }
    }),
    new webpack.DllPlugin({
      path: path.resolve(ROOT_PATH, 'dist/lib', 'manifest.json'),
      name: '[name]_lib',
      context: ROOT_PATH
    })
  ]
}
